<html>
<head><meta charset="utf-8"><title>detect if crate is core or std · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/detect.20if.20crate.20is.20core.20or.20std.html">detect if crate is core or std</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="246538279"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/detect%20if%20crate%20is%20core%20or%20std/near/246538279" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Riccardo D&#x27;Ambrosio <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/detect.20if.20crate.20is.20core.20or.20std.html#246538279">(Jul 20 2021 at 02:23)</a>:</h4>
<p>how do i go about checking if the current crate being compiled is core or std? crate_name doesnt seem reliable</p>



<a name="246551682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/detect%20if%20crate%20is%20core%20or%20std/near/246551682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Stu <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/detect.20if.20crate.20is.20core.20or.20std.html#246551682">(Jul 20 2021 at 07:06)</a>:</h4>
<p>I once asked the same question and got the answer that there is no reliable way except using crate_name, which is not reliable</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>